<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>数组数据类型</title>
</head>
<body>
<script>
  //数组数据类型
  var arr = [100,20,'nihao',true];
  console.log(arr);
  //获取数组的长度
  console.log(arr.length);
  //修改数组的长度
  arr.length = 3;
  console.log(arr.length);
  //访问索引为2的元素
  console.log(arr[2]);

</script>
</body>
</html>